<template>
  <el-container>
    <el-main>
      <index-header ref="index-header" @switchTap="switchTap" @search="search"></index-header>
      <router-view ref='target-name'></router-view>
      <el-backtop style="color: #d88930;background-color: #0005;" :bottom="100"></el-backtop>
    </el-main>
    <el-footer>
      暗黑影院 © 2020 涛哥版权所有
    </el-footer>
  </el-container>
</template>

<script>
    import indexHeader from '../../components/index-header';
    export default {
        name: "index",
        components:{
            indexHeader
        },
        provide(){
            return{
                setTitle: this.setTitle
            };
        },
        data(){

        },
        mounted() {

        },
        methods:{
            setTitle(){
                this.$refs['index-header'].setTitle(this.getUrlKey("id"));
            },
            switchTap: function () {
                if (this.$refs['target-name'].getPageName() == "videoList"){
                    this.$refs['target-name'].getTypeVideoByID(1, 20, this.getUrlKey("id"))
                }
            },
            search:function () {
                if (this.$refs['target-name'].getPageName() == "videoList") {
                    this.$refs['target-name'].getVideoByName(1, 20, this.getUrlKey("name"))
                }
            }
        }
    }
</script>

<style scoped>
  .el-container{
    background-color: #13151f;
    background-image: url("../../assets/hero_area.png");
    background-repeat: no-repeat;
    overflow-y: hidden;
  }
  .el-main{
    overflow-y: hidden;
  }
  .el-footer{
    width: 100%;
    height: 100px;
    text-align: center;
    color: #999999;
    border-top: 1px solid #999999;
    margin-top: 60px;
    font-size: 10px;
    line-height: 60px;
  }
</style>
